﻿#include "chnswitch-tbar.h"

ChnSwitchTBar::ChnSwitchTBar(QWidget *parent) : QWidget(parent)
{
    lab_title_ = new QLabel(tr("switch ctrl area"), this);
    btn_del_ = new QPushButton(this);
    btn_delall_ = new QPushButton(this);

    connect(btn_del_, SIGNAL(clicked()),
            this, SLOT(slot_btn_del()));
    connect(btn_delall_, SIGNAL(clicked()),
            this, SLOT(slot_btn_delall()));
}

void ChnSwitchTBar::slot_btn_del()
{

}

void ChnSwitchTBar::slot_btn_delall()
{

}

void ChnSwitchTBar::resizeEvent(QResizeEvent *event)
{
    int w = event->size().width();
    int h = event->size().height();
    int btnw = 30;
    int btnh = 25;
    lab_title_->setGeometry(5, 2, 200, 25);
    btn_del_->setGeometry(w-100, 2, btnw, btnh);
    btn_delall_->setGeometry(w-60, 2, btnw, btnh);
    event->accept();
}
